package com.shoe.service.impl;

import com.shoe.mapper.AdminAftersaleMapper;
import com.shoe.service.AdminAftersaleService;
import com.shoe.util.DateConversion;
import com.shoe.util.ResultUtil;
import com.shoe.vo.AdminAftersaleVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminAftersaleServiceImpl implements AdminAftersaleService {

    @Autowired
    AdminAftersaleMapper adminAftersaleMapper;

    @Autowired
    ResultUtil resultUtil;

    @Override
    public List<AdminAftersaleVo> selectAdminAftersaleByAftsaleIdPag(Integer page, Integer limit, String aftsaleSolve) {
        return adminAftersaleMapper.selectAdminAftersaleByAftsaleIdPag(page, limit, aftsaleSolve);
    }

    @Override
    public List<AdminAftersaleVo> selectAdminAftersaleByAftsaleId(String aftsaleSolve) {
        return adminAftersaleMapper.selectAdminAftersaleByAftsaleId(aftsaleSolve);
    }

    @Override
    public List<AdminAftersaleVo> seLuiAaftAll() {
        return adminAftersaleMapper.seLuiAaftAll();
    }

    @Override
    public List<AdminAftersaleVo> seLuiAaftPage(Integer page, Integer limit) {
        return adminAftersaleMapper.seLuiAaftPage(page, limit);
    }

    @Override
    public int updataAdminAftersale(Integer aftSaleId, String aftSaleState, String aftSaleReq) {

        DateConversion dateConversion = new DateConversion();
        String aftSaleDate = dateConversion.Data2Sting();

        return adminAftersaleMapper.updataAdminAftersale(aftSaleId, aftSaleDate, aftSaleState, aftSaleReq);
    }

    @Override
    public int deleteAdminAftersale(Integer aftSaleId) {
        return adminAftersaleMapper.deleteAdminAftersale(aftSaleId);
    }
}
